Introduction

This report explores attitudes towards gender roles and immigration using data from the European Value Study (EVS) 2017. Key variables analyzed include v72 and v80, which respectively measure perceptions on maternal employment effects and job priority during scarcity. We will incorporates demographic information such as age, sex, and education level for a comprehensive analyses.

# library
library(dplyr)
library(tidyr)
library(haven)
library(knitr)
library(ggplot2)
library(summarytools)
library(ggExtra)
library(texreg)
library(plotly)
# load cleaned data
evs <- readRDS("data/evs.rds")

Descriptive Analysis

Below tables are descriptive statistics for both continuous and categorical variables. The mean values for v72 and v80 are 2.7 and 2.3, respectively. The data also illustrates that medium education levels comprise the highest proportion across countries, followed by higher and lower education levels.

# table for continuous variables
sum_v72 <- summary(evs$v72)
sum_v80 <- summary(evs$v80)
sum_age <- summary(evs$age)

tab_continuous <- tibble("Variables" = c("v72", "v80", "age"),
                         "Mininum" = c(sum_v72["Min."], sum_v80["Min."], sum_age["Min."]),
                         "1st Qu." = c(sum_v72["1st Qu."], sum_v80["1st Qu."], sum_age["1st Qu."]),
                         "Median" = c(sum_v72["Median"], sum_v80["Median"], sum_age["Median"]),
                         "Mean" = c(round(sum_v72["Mean"], 3), round(sum_v80["Mean"], 3), sum_age["Mean"]),
                         "3rd Qu." = c(sum_v72["3rd Qu."], sum_v80["3rd Qu."], sum_age["3rd Qu."]),
                         "Maximum" = c(sum_v72["Max."], sum_v80["Max."], sum_age["Max."]))

kable(tab_continuous, caption = "Summary Statistics for v72 and v80")
Summary Statistics for v72 and v80
Variables Mininum 1st Qu. Median Mean 3rd Qu. Maximum
v72 1 2 3 2.71300 3 4
v80 1 1 2 2.31100 3 5
age 18 35 50 49.61203 64 82
# table for categorical variables
evs$sex <- factor(evs$sex, levels = c(1, 2), labels = c("Male", "Female"))
evs$edu <- factor(evs$edu, levels = c(1, 2, 3, 66), labels = c("lower", "medium", "higher", "other"))

evs_sex <- evs %>%
  group_by(sex) %>%
  summarise(frequency = n(),
            proportion = round(n()/nrow(evs), 4)) %>%
  mutate(variable = "sex",
         value = sex) %>%
  select(variable, value, frequency, proportion)

evs_edu <- evs %>%
  group_by(edu) %>%
  summarise(frequency = n(),
            proportion = round(n()/nrow(evs), 4)) %>%
  mutate(variable = "education",
         value = edu) %>%
  select(variable, value, frequency, proportion)

tab_categorical <- bind_rows(evs_sex, evs_edu)
kable(tab_categorical, caption = "Summary Statistics for sex and education")
Summary Statistics for sex and education
variable value frequency proportion
sex Male 26293 0.4424
sex Female 33119 0.5572
sex NA 26 0.0004
education lower 12127 0.2040
education medium 26836 0.4515
education higher 20003 0.3365
education other 84 0.0014
education NA 388 0.0065

Change in Attitudes by Age

The two graphs presented below illustrates how the two variables of interest change with age. Notably, the average disagreement towards both child suffers and job to national variables decreases as age increases. Particularly, there is a more significant decrease observed in the v72 variable. This finding suggests that people are more likely to agree that child suffer when their mother works and that job priority should be given to nationals as they get older.

# table of average v72 and v80 by age
tab_ave_age <- evs %>%
  select(v72, v80, age) %>%
  group_by(age) %>%
  summarise(v72 = mean(v72, na.rm = TRUE),
            v80 = mean(v80, na.rm = TRUE))
tab_ave_age
## # A tibble: 66 × 3
##    age         v72   v80
##    <dbl+lbl> <dbl> <dbl>
##  1 18         2.86  2.43
##  2 19         2.84  2.35
##  3 20         2.83  2.36
##  4 21         2.83  2.38
##  5 22         2.85  2.37
##  6 23         2.86  2.36
##  7 24         2.88  2.51
##  8 25         2.84  2.40
##  9 26         2.85  2.37
## 10 27         2.87  2.33
## # ℹ 56 more rows
# grraph for v72
chart_ave_v72 <- ggplot(tab_ave_age, aes(x=age, y=v72)) +
  geom_line(color = "blue") +
              labs(title = "Average Disagreement of v72 by Age", 
                   x = "Age", 
                   y = "Average Disagreement")

ggplotly(chart_ave_v72)
  # grraph for v80
chart_ave_v80 <- ggplot(tab_ave_age, aes(x=age, y=v80)) +
  geom_line(color = "blue") +
              labs(title = "Average Disagreement of v80 by Age", 
                   x = "Age", 
                   y = "Average Disagreement")
ggplotly(chart_ave_v80)

Regression Models

The table below shows regression models for both attitudes towards Child suffers (v72) and Job to national (v80). The models include respondents’ age, age squared, sex and education. The regression models show that age, gender, and education significantly influence attitudes towards gender roles and immigration. Particularly, in the model for v72, it’s ovserved that disagreement regarding the idea that a child suffers if the mother works increases by 0.06 among females (p<0.05). Additionally, individuals with higher education levels tend to exhibit greater disagreement with attitudes towards both “Child suffers” and “Job to national”. disagreement on that child suffers if the mother works increases 0.06 in females (p<0.05). Also, people who have higher education levels tend to have more disagreement attitudes towards child suffers and job to national.

evs$edu <- as.factor(evs$edu)
evs$sex <- as.factor(evs$sex)

# regression model of v72
reg_v72 <- lm(v72 ~ age + I(age^2) + sex + edu, data = evs)

# regression model of v80
reg_v80 <- lm(v80 ~ age + I(age^2) + sex + edu, data = evs)

# present outputs from stats model texreg (texreg: pdf, htmlreg: html)
model_names <- c("Child suffers(v72)", "Job to national(v80)")
coef_names <- c("Intercept", "Age", "Age Squared", "Female", "Education:medium", "Education:higher", "Education:other")

htmlreg(list(reg_v72, reg_v80), 
        custom.model.names = model_names, 
        custom.coef.names = coef_names,
        caption = "Outputs from Regression Models", type = "html")
Outputs from Regression Models
  Child suffers(v72) Job to national(v80)
Intercept 2.69*** 2.32***
  (0.03) (0.04)
Age -0.00** -0.00
  (0.00) (0.00)
Age Squared -0.00 -0.00
  (0.00) (0.00)
Female 0.06*** -0.03**
  (0.01) (0.01)
Education:medium 0.12*** -0.04*
  (0.01) (0.01)
Education:higher 0.40*** 0.42***
  (0.01) (0.02)
Education:other 0.55*** 0.47***
  (0.10) (0.14)
R2 0.05 0.03
Adj. R2 0.05 0.03
Num. obs. 57460 57999
***p < 0.001; **p < 0.01; *p < 0.05